package com.runfast.waimai.web.controller;

import com.runfast.common.dao.model.RunfastCuser;
import com.runfast.common.utils.TokenUtil;
import com.runfast.common.web.entity.Result;
import com.runfast.waimai.dao.model.*;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 我的界面接口
 */
@RestController("userWmMyController")
@RequestMapping(value= "/api/user/wm/my", headers = "token")
public class MyController {

    /**
     * 修改用户信息
     * @param cuser
     * @param token
     * @return
     */
    @PostMapping("/update")
    public Result update(@ModelAttribute RunfastCuser cuser, @RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }

    /**
     *根据原密码修改密码
     * @param oldPwd 原密码
     * @param newPwd 新密码
     * @param token
     * @return
     */
    @PostMapping("/updatePwdByOld")
    public Result updatePwdByOld(@RequestParam String oldPwd, @RequestParam String newPwd, @RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }

    /**
     * 根据短信验证码修改密码
     * @param smsCode 短信验证码
     * @param newPwd 新密码
     * @param token
     * @return
     */
    @PostMapping("/updatePwdBySmsCode")
    public Result updatePwdBySmsCode(@RequestParam String smsCode, @RequestParam String newPwd, @RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }

    /**
     * 获取当前用户信息
     * @param token
     * @return
     */
    @PostMapping("/info")
    public Result<List<RunfastActivity>> list(@RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }


    /**
     * 商户加盟
     * @param businessalliance
     * @param token
     * @return
     */
    @PostMapping("/join")
    public Result join(@ModelAttribute RunfastBusinessalliance businessalliance, @RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }


    /**
     * 用户投诉
     * @param complain
     * @param token
     * @return
     */
    @PostMapping("/complain")
    public Result complain(@ModelAttribute RunfastComplain complain, @RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }

    /**
     * 获取代理商客服
     * @param agentId
     * @param token
     * @return
     */
    @PostMapping("/custom")
    public Result<RunfastCustom> custom(@RequestParam int agentId, @RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }

    /**
     *获取用户积分明细
     * @param token
     * @return
     */
    @PostMapping("/scoreRecord")
    public Result<RunfastScorerecord> scoreRecord(@RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }





}
